home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 04 geoProgramming / GBNTRO.ARC / GB NOTES #1 (.txt) next >
Encoding:
GEOS ConVerT  |  2019-04-13  |  8.2 KB  |  173 lines

  1. GB Notes #1
  2. PRG formatted GEOS file V1.0
  3. EX-800 V3.5 (GC)
  4. OP V2.0 or higher
  5. Patcher
  6. BLASTER'S CONVERTER V2.5
  7. INTRO.GB PATCHER
  8. GB NOTES #1
  9. Write Image V2.1
  10. Red Storm
  11. geoWrite    V1.1
  12.   This file was created with
  13. Wrong is Write.
  14.   Written by Joe Buckley.
  15.      @geoBasic Module Definitions:
  16. VLIR #    Constant    Loads @    Description
  17. R_MAIN    $0400    Resident code. Two JMP's @ $0400 then skip
  18.             to $07fc to leave room for screen memory.
  19.             This module contains all the code that must
  20.             always be available.  All the other modules
  21.             use the subroutines contained here.
  22. 1    R_FILE    $4ec7    High level disk file stuff (Rename, Open, etc).
  23. 2    R_DA    *$75d8    Run's DA's.  *Loads inside FG_BUFFER on 64
  24.             or SCREEN_BASE on the 128.  This keeps it
  25.             from overwriting Basic's code.
  26. 3    R_INIT    $4ec7    geobasic Initialization code. Loaded from
  27.             Resident code.    
  28. 4    R_LOAD    $7501    Basic Program loader. Loads into FG_BUFFER
  29.             (see R_DA).
  30. 5    R_BINT    $4f96    Interpreter (BasRes). This is the module that
  31.             actually runs the user's program.
  32. 6    R_BINT2    $0400
  33. 7    R_FONT    $6f8b    Font Manager (cFont, cSysInfo, and
  34.             GetDiskBitmap).
  35. 8    R_DISK    $6f8b    Lower level disk stuff (reading bytes, etc).
  36. 9    R_PRINT    $6f8b    Printer Routines.
  37. 10    R_MENU    $4ec7    Menu Utility.
  38. 11    R_DBOX    $4ec7    Dialog Box Utility.
  39. 12    R_ICON    $4ec7    Icon Utility.
  40. 13    R_BMAP    $4ec7    Bitmap Utility.
  41. 14    R_SPRT    $4ec7    Sprite Utility.
  42. 15    R_EDIT    $4503    Editor.
  43. 16    R_APPL    $4b00    Make Application (run-time).
  44. 17    R_DEBUG    $47cc    Debugger.
  45.      @GB Program, Disk Layout
  46.      @Records 0 to 9 -
  47.  left empty to leave room for GB code when making run-time.
  48.      @Record #10 -
  49.  VLIR table.  Keeps track of what modules hold what line #'s.  Used for doing the VLIR splitting.  The table is a single sector and there is one eight byte entry for each program module.  The entries have the following format:
  50.     .word ?        ; Highest line number in module.
  51.     .word ?        ; Length_of_module (in bytes)
  52.     .byte ?        ; nesting_level
  53.     .byte ?        ; write_status
  54.     .byte ?        ; modified_status
  55.     .byte NULL        ; terminator
  56. The very first entry is a bit different.  It looks like this:
  57.     .word ???        ; (NULLS)
  58.     .byte x        ; number of entries in the VLIR table (not
  59.             ; counting this one which is entry #0).
  60.     .byte x        ; number of labels in the label table (minus 1,
  61.             ; labels are numbered from zero!).  If there
  62.             ; are no labels then it equals $ff.
  63.     .byte $f0?
  64.     .byte $f6?
  65.     .word ???
  66.      @Record #11 -
  67.  Object table.  All of the geos objects are store in this record, one right after the other.
  68.      @Record #12 -
  69.  Label Table.  Here is where the labels (@xxxx and object names) are stored.  Each label entry is 8 bytes long and has the following format:
  70.      @For @ labels:
  71.     .block 6    ; label name padded with NULLs
  72.     .word line_number
  73.      @For object labels (i.e. bitmaps, menus, icons, etc.):
  74.     .byte type        ; $80 = Menu
  75.             ; $81 = DB
  76.             ; $82 = Icon
  77.             ; $83 = Sprites
  78.             ; $84 = Bitmap
  79.     .block 5        ; object name padded with NULLs
  80.     .word address    ; where in memory the object is located.
  81.      @Record #13 onward - 
  82. Holds the basic program lines.  Each line has the following format:
  83.     .byte        ; length_of_line
  84.     .word        ; line_number
  85.     .block ???        ; now comes the tokenized text
  86.     .byte NULL        ; terminator
  87.      @Record #126 backward -
  88.  Disk loadable bitmaps are stored beginning at record #126.  Additional bitmaps are added backwards until they meet up with the program records.  Note that 
  89.  disk loadable bitmaps are stored here.  Regular bitmaps are stored in the Object Table (record #11).
  90.      @Getting Registers after a CALL:
  91. After using the CALL command use can get the return values of the registers by PEEKing the following memo
  92.      @Getting Registers after a CALL:
  93. After using the CALL command use can get the return values of the registers by PEEKing the following memory locations:
  94.      @A    = 
  95. $28a (650)
  96.      @X     = 
  97. $28b (651)
  98.      @Y    = 
  99. $28c (652)
  100.      @SR    = 
  101. $28d (653)
  102.      @POP Command:
  103. The old (V1.0) Pop command had several serious bugs that caused a system crash.  The new version works like this:  executing a POP will remove the current GOSUB/WHILE/REPEAT stack frame.  In other words it will allow you to 'forget' that you are in a subroutine or loop (this does not apply to a FOR...NEXT loop).  One thing to keep in mind is that after executing a POP you must not allow the program to reach the RETURN/LOOP/UNTIL commands.  The best way of doing this is with a construct like this:
  104.      10 GOSUB DoSomething
  105.     20 END
  106.     50 @DoSomething
  107.     60   <various commands>
  108.     70   IF something = error THEN POP : GOTO @DoError
  109.     80 RETURN
  110.     100 @DoError
  111.     110    .... etc
  112. Of course if you are two levels deep in a subroutine and execute a POP, then you execute a RETURN the program will return TWO levels back rather then just one.  Could come in handy at times.
  113.      @GB Variables - zero page
  114. Name    Address    Size
  115.      @GB Variables - zero page
  116. Name    Address    Size    Description
  117. basCur    $81/129    word    current character in basic memory
  118. basBegin    $83/131    word    pointer to beginning of basic
  119. basicEnd    $85/133    word    pointer to beginning of labels             (minus 1 for end of basic)
  120. varBegin    $87/135    word    pointer to the beginning of
  121.             variables
  122. arrayBegin    $89/137    word    pointer to the beginning of arrays
  123. arrayEnd    $8b/139    word    pointer to the end of arrays
  124. arrayLength    $8d/141    word    length of array/temporary register
  125. strnBegin    $8f/143    word    pointer to the beginning of strings
  126. zeroShift    $91/145    byte    used by floating point routines
  127. dec_pt    $92/146    byte    used by floating point routines
  128. varPtr    $93/147    word    pointer to value of variable
  129. machine_type    $95/149    byte    0 if c64, $80 if 128
  130. strnStack    $96/150    9 bytes    stack for three temp string             descriptors
  131. strnStkIndx    $9f/159    byte    index into strnStack
  132. prevStrnStkIndx    $a0/160    byte    previous strnStack index
  133. rdIndex    $a1/161    byte    index to reading in strings
  134. gax2    $a2/162    word    (not commented in source code)
  135. curStrn    $a4/164    word    pointer to most current string that
  136.             was added or moved.
  137. strnDes    $a6/166    word    pointer to string descriptor
  138. descPtr    $a8/168    word    pointer to string descriptor     for             string             operations.
  139. geosBegin    $aa/170    word    pointer to the beginning of object
  140.             (menus, icons, etc.) data.
  141. memAmnt    $ac/172    word    amount of memory to insert or             delete
  142. curKeyBrdPos    $ae/174    word    (not commented in source)
  143. SetForIOTemp    $b0/176    word    (not commented in source)
  144. curLineNum    $b2/178    word    current line number being executed or
  145.             $ff in direct mode
  146. VLIRtabl    $b4/180    word    pointer to beginning of VLIR table
  147. xPos    $b6/182    word    X position for PRINT
  148. yPos    $b8/184    byte    Y position for PRINT
  149. opMask    $b9/185    byte    current comparison being performed
  150.             >/1, =/2, </4 or any combo of these
  151. comm_Flag    $ba/186    byte    flag for which command is currently
  152.             being executed: 0 = none, 1 = RUN,
  153.             -1 = LIST - used by the Editor
  154. dataPtr    $bc/188    word    pointer in basic to DATA statements
  155. FP_sgns    $be/190    byte    temp flag for sign of FP number
  156. exp_found    $bf/191    byte    flag for whether exponent was         found
  157. fontBegin    $c0/192    word    pointer to beginning of font
  158. lastFontPtr    $c2/194    word    (not commented in source)
  159. curDBPtr    $c4/196    word    pointer to current dialog box data
  160. sprite stuff    $c6/198    36 bytes    internal sprite variables
  161. r16    $ea/234    word    more registers
  162. r17    $ec/236    word
  163. r18    $ee/238    word
  164. r19    $f0/240    word
  165. r20    $f2/242    word
  166. r21    $f4/244    word
  167. numDim    $f6/246    byte    number of dimensions in array
  168. grbackground    $f7/247    byte    FG/BG colors of graphics screen
  169. dig_found    $f8/248    byte    flag for whether a digit was found
  170.             when converting strings to FP
  171. operand_mask    $f9/249    byte    >/1, =/2, </4
  172. strnFlag    $fa/250    byte    $ff if string expected, else 0    
  173.